# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='AgentUserView',
            fields=[
                ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
                ('user', models.CharField(max_length=20)),
                ('org_id', models.IntegerField()),
                ('agent', models.CharField(max_length=20)),
                ('start_time', models.DateTimeField()),
                ('end_time', models.DateTimeField()),
            ],
            options={
                'db_table': 'agent_user_view',
            },
        ),
        migrations.CreateModel(
            name='ByFromApprover',
            fields=[
                ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
                ('typeid', models.IntegerField()),
                ('typename', models.CharField(max_length=50)),
                ('name', models.CharField(max_length=50)),
                ('approver_record', models.CharField(max_length=20)),
                ('time', models.FloatField()),
                ('endtime', models.DateTimeField()),
                ('starttime', models.DateTimeField()),
            ],
            options={
                'db_table': 'by_type_approver',
            },
        ),
        migrations.CreateModel(
            name='ByFromType',
            fields=[
                ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
                ('name', models.CharField(max_length=50)),
                ('types', models.IntegerField()),
                ('endtime', models.DateTimeField()),
                ('starttime', models.DateTimeField()),
                ('time', models.FloatField()),
            ],
            options={
                'db_table': 'by_type',
            },
        ),
        migrations.CreateModel(
            name='ByFromTypeMonth',
            fields=[
                ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
                ('type_name', models.CharField(db_column='type', max_length=50)),
                ('type_id', models.IntegerField()),
                ('time', models.FloatField()),
                ('date', models.DateField()),
            ],
            options={
                'db_table': 'by_from_type_month_view',
            },
        ),
        migrations.CreateModel(
            name='ByNode',
            fields=[
                ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
                ('next_name', models.CharField(db_column='next', max_length=50)),
                ('time', models.FloatField(db_column='num')),
                ('approver_record', models.CharField(max_length=20)),
            ],
            options={
                'db_table': 'by_node_view',
            },
        ),
        migrations.CreateModel(
            name='Duty',
            fields=[
                ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
                ('name', models.CharField(max_length=50)),
                ('code', models.CharField(blank=True, max_length=50, null=True)),
                ('desc', models.CharField(blank=True, max_length=500, null=True)),
            ],
            options={
                'db_table': 'tb_duty',
            },
        ),
        migrations.CreateModel(
            name='ForwardBackMode',
            fields=[
                ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
                ('name', models.CharField(max_length=50)),
            ],
            options={
                'db_table': 'tb_forward_back_mode',
            },
        ),
        migrations.CreateModel(
            name='ForwardMode',
            fields=[
                ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
                ('name', models.CharField(max_length=50)),
            ],
            options={
                'db_table': 'tb_forward_mode',
            },
        ),
        migrations.CreateModel(
            name='NodeCase',
            fields=[
                ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
                ('order_number', models.IntegerField(blank=True, null=True)),
                ('review_result', models.CharField(max_length=100)),
                ('approver', models.CharField(blank=True, max_length=45, null=True)),
                ('rectime', models.DateTimeField(blank=True, null=True)),
                ('username', models.CharField(max_length=45)),
                ('user_choose', models.CharField(blank=True, max_length=100, null=True)),
                ('status', models.CharField(blank=True, max_length=10, null=True)),
                ('user_mode', models.CharField(blank=True, db_column='user_mode', max_length=25, null=True)),
                ('forward_mode', models.CharField(blank=True, db_column='forward_mode', max_length=25, null=True)),
                ('forward_back_mode', models.CharField(blank=True, db_column='forward_back_mode', max_length=25, null=True)),
                ('reject_mode', models.CharField(blank=True, db_column='reject_mode', max_length=25, null=True)),
                ('forward_list', models.CharField(blank=True, max_length=100, null=True)),
                ('user_role_list', models.CharField(blank=True, max_length=100, null=True)),
                ('agent', models.CharField(blank=True, max_length=45, null=True)),
            ],
            options={
                'db_table': 'tb_node_case',
            },
        ),
        migrations.CreateModel(
            name='NodeGroup',
            fields=[
                ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
                ('name', models.CharField(max_length=45)),
                ('order_number', models.IntegerField()),
            ],
            options={
                'db_table': 'tb_node_group',
            },
        ),
        migrations.CreateModel(
            name='Org',
            fields=[
                ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
                ('org_name', models.CharField(max_length=100)),
                ('parent_id', models.IntegerField(blank=True, null=True)),
                ('create_date', models.DateTimeField()),
                ('org_code', models.CharField(blank=True, max_length=50, null=True)),
                ('cost_code', models.CharField(blank=True, max_length=50, null=True)),
                ('org_desc', models.CharField(blank=True, max_length=500, null=True)),
                ('org_desc2', models.CharField(blank=True, max_length=500, null=True)),
                ('is_active', models.IntegerField()),
            ],
            options={
                'db_table': 'tb_org',
            },
        ),
        migrations.CreateModel(
            name='OrgLevel',
            fields=[
                ('level', models.IntegerField(primary_key=True, serialize=False)),
                ('level_name', models.CharField(max_length=100)),
                ('level_code', models.CharField(max_length=50)),
                ('duty', models.ForeignKey(to='wfs.Duty')),
            ],
            options={
                'db_table': 'tb_org_level',
            },
        ),
        migrations.CreateModel(
            name='OrgRole',
            fields=[
                ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
                ('name', models.CharField(max_length=100)),
                ('code', models.CharField(max_length=50)),
                ('desc', models.CharField(max_length=500)),
                ('create_date', models.DateTimeField()),
            ],
            options={
                'db_table': 'tb_org_role',
            },
        ),
        migrations.CreateModel(
            name='RejectMode',
            fields=[
                ('id', models.IntegerField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=50)),
            ],
            options={
                'db_table': 'tb_reject_mode',
            },
        ),
        migrations.CreateModel(
            name='ReminderLog',
            fields=[
                ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
                ('no', models.CharField(max_length=50)),
                ('rectime', models.DateTimeField()),
            ],
            options={
                'db_table': 'tb_workflow_reminder_log',
            },
        ),
        migrations.CreateModel(
            name='Status',
            fields=[
                ('status_code', models.IntegerField(primary_key=True, serialize=False)),
                ('status_name', models.CharField(max_length=100)),
                ('status_desc', models.CharField(max_length=100)),
                ('id', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
                ('password', models.CharField(max_length=128)),
                ('last_login', models.DateTimeField(blank=True, null=True)),
                ('is_superuser', models.IntegerField()),
                ('username', models.CharField(max_length=30, unique=True)),
                ('first_name', models.CharField(max_length=30)),
                ('last_name', models.CharField(max_length=30)),
                ('email', models.CharField(max_length=254)),
                ('is_staff', models.IntegerField()),
                ('is_active', models.IntegerField()),
                ('date_joined', models.DateTimeField()),
                ('nfc_id', models.CharField(blank=True, db_column='NFC_id', max_length=100, null=True)),
                ('ext', models.CharField(blank=True, max_length=50, null=True)),
                ('short_number', models.CharField(blank=True, max_length=50, null=True)),
                ('mobile_phone', models.CharField(blank=True, max_length=50, null=True)),
                ('head', models.CharField(blank=True, max_length=100, null=True)),
                ('sign', models.CharField(blank=True, max_length=100, null=True)),
                ('status', models.ForeignKey(to='wfs.Status')),
            ],
            options={
                'db_table': 'tb_user',
            },
        ),
        migrations.CreateModel(
            name='UserMode',
            fields=[
                ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
                ('name', models.CharField(max_length=50)),
            ],
            options={
                'db_table': 'tb_user_mode',
            },
        ),
        migrations.CreateModel(
            name='UserOrg',
            fields=[
                ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
                ('create_date', models.DateTimeField()),
                ('org', models.ForeignKey(to='wfs.Org')),
                ('org_role', models.ForeignKey(to='wfs.OrgRole')),
                ('user', models.ForeignKey(to='wfs.User')),
            ],
            options={
                'db_table': 'tb_user_org',
            },
        ),
        migrations.CreateModel(
            name='WfsAgent',
            fields=[
                ('id', models.IntegerField(primary_key=True, serialize=False)),
                ('user', models.CharField(max_length=20)),
                ('username', models.CharField(max_length=20)),
                ('rectime', models.DateTimeField()),
                ('update', models.DateTimeField()),
                ('enabled', models.IntegerField(blank=True, null=True)),
                ('agent', models.ForeignKey(to='wfs.User')),
                ('org', models.ForeignKey(to='wfs.Org')),
            ],
            options={
                'db_table': 'tb_wfs_agent',
            },
        ),
        migrations.CreateModel(
            name='WFSOrgRole',
            fields=[
                ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
                ('rectime', models.DateTimeField()),
                ('org', models.ForeignKey(to='wfs.Org')),
            ],
            options={
                'db_table': 'tb_wfs_org_role',
            },
        ),
        migrations.CreateModel(
            name='Workflow',
            fields=[
                ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
                ('name', models.CharField(max_length=20)),
                ('description', models.CharField(blank=True, max_length=150, null=True)),
                ('username', models.CharField(blank=True, max_length=45, null=True)),
                ('effective_time', models.IntegerField(blank=True, null=True)),
                ('end', models.IntegerField(blank=True, null=True)),
                ('start', models.IntegerField(blank=True, null=True)),
                ('enabled', models.IntegerField(blank=True, null=True)),
                ('founder', models.CharField(blank=True, max_length=30, null=True)),
                ('rectime', models.DateTimeField(blank=True, null=True)),
                ('update_time', models.DateTimeField(blank=True, null=True)),
            ],
            options={
                'db_table': 'tb_workflow',
            },
        ),
        migrations.CreateModel(
            name='WorkflowAgent',
            fields=[
                ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
                ('rectime', models.DateTimeField()),
                ('start_time', models.DateTimeField()),
                ('end_time', models.DateTimeField()),
                ('status', models.IntegerField()),
                ('action', models.IntegerField()),
                ('form_list', models.TextField()),
                ('user_agent', models.ForeignKey(to='wfs.WfsAgent')),
            ],
            options={
                'db_table': 'tb_workflow_agent',
            },
        ),
        migrations.CreateModel(
            name='WorkflowApprovalRecord',
            fields=[
                ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
                ('status', models.CharField(blank=True, max_length=20, null=True)),
                ('approver', models.CharField(blank=True, max_length=20, null=True)),
                ('username', models.CharField(blank=True, max_length=45, null=True)),
                ('next', models.CharField(blank=True, max_length=20, null=True)),
                ('start_time', models.DateTimeField(blank=True, null=True)),
                ('end_time', models.DateTimeField(blank=True, null=True)),
                ('order_number', models.IntegerField(blank=True, null=True)),
                ('action', models.CharField(blank=True, max_length=20, null=True)),
                ('next_approver', models.CharField(max_length=100)),
                ('desc', models.CharField(max_length=200)),
                ('signature', models.CharField(max_length=200)),
                ('filename', models.CharField(max_length=200)),
            ],
            options={
                'db_table': 'tb_workflow_approval_record',
            },
        ),
        migrations.CreateModel(
            name='Workflownode',
            fields=[
                ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
                ('name', models.CharField(max_length=45)),
                ('order_number', models.IntegerField(blank=True, null=True)),
                ('property', models.TextField()),
                ('workflow', models.ForeignKey(to='wfs.Workflow')),
            ],
            options={
                'db_table': 'tb_workflownode',
            },
        ),
        migrations.CreateModel(
            name='Workflowrecord',
            fields=[
                ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
                ('no', models.CharField(blank=True, db_column='NO', max_length=50, null=True)),
                ('pdfmode', models.CharField(max_length=200)),
                ('desc', models.CharField(blank=True, max_length=200, null=True)),
                ('username', models.CharField(blank=True, max_length=45, null=True)),
                ('applicant', models.CharField(blank=True, max_length=45, null=True)),
                ('status', models.CharField(blank=True, max_length=45, null=True)),
                ('create_time', models.DateTimeField(blank=True, null=True)),
                ('pdf', models.CharField(max_length=200)),
                ('end_time', models.CharField(blank=True, max_length=45, null=True)),
                ('org_id', models.IntegerField()),
                ('signature_graph', models.IntegerField()),
                ('workflow', models.ForeignKey(to='wfs.Workflow')),
            ],
            options={
                'db_table': 'tb_workflowrecord',
            },
        ),
        migrations.CreateModel(
            name='WorkflowRole',
            fields=[
                ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
                ('role', models.CharField(max_length=30)),
                ('desc', models.CharField(max_length=100)),
            ],
            options={
                'db_table': 'tb_workflow_role',
            },
        ),
        migrations.CreateModel(
            name='WorkflowRoleUser',
            fields=[
                ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
                ('user_id', models.IntegerField()),
                ('workflow_role', models.ForeignKey(to='wfs.WorkflowRole')),
            ],
            options={
                'db_table': 'tb_workflow_role_user',
            },
        ),
        migrations.AlterUniqueTogether(
            name='workflowrole',
            unique_together=set([('role', 'desc')]),
        ),
        migrations.AddField(
            model_name='workflowapprovalrecord',
            name='workflow_record',
            field=models.ForeignKey(to='wfs.Workflowrecord'),
        ),
        migrations.AddField(
            model_name='wfsorgrole',
            name='role',
            field=models.ForeignKey(to='wfs.WorkflowRole'),
        ),
        migrations.AddField(
            model_name='org',
            name='org_level',
            field=models.ForeignKey(to='wfs.OrgLevel'),
        ),
        migrations.AddField(
            model_name='nodegroup',
            name='workflowrecord',
            field=models.ForeignKey(to='wfs.Workflowrecord'),
        ),
        migrations.AddField(
            model_name='nodecase',
            name='group',
            field=models.ForeignKey(to='wfs.NodeGroup'),
        ),
    ]
